<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<style type="text/css">
			.top-button{float: right;margin-top: 2.5%;margin-right: -3%;border: 0;background-color: #F7F7F7;color: #007AFF;list-style: 0;}
			.mui-btn-primary:active{background-color: #F7F7F7 !important;border: 0!important;}
			.tishi-div{width: 92%;margin-left: 4%;margin-top: 8%;}
			.tishi-div span{color: #A2A2A2;font-size: 95%;}
			.mui-content .mui-input-clear{margin-bottom: 0;border: 0;width: 88%;}
			.makephenum-div{display: flex;padding: 4% 5%;margin-top: 5%;align-items: center;background-color: #FFFFFF;}
			.haoarea-div{color: #A2A2A2;}
		</style>
	</head>

	<body>
		
		<header class="mui-bar mui-bar-nav" id="header" >
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">更换手机号</h1>
		    <button class="top-button mui-btn-primary" id="buttonm">下一步</button>
		</header>
		
		
		<div class="mui-content">
		    <div class="tishi-div">
		    	<span>当前手机号: <span id="phnum" ></span>。更换成功后，下次登录必须使用更换后的手机号才能登录。</span>
		    </div>
		    
		    <div id="" class="makephenum-div">
		    	 <span class="haoarea-div">+86</span>
		    	 <input type="number" class="mui-input-clear" placeholder="此处输入手机号" id="inputt" value=""/> 
		    </div>
		</div>
		
		
		
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/immersed.js" ></script>
	<script type="text/javascript">
		mui.init();
		window.onload = function(){
		mui.plusReady(function(){
			
			starbar();
			plus.navigator.setStatusBarStyle('dark');
			
			var jphnum = document.getElementById('phnum');
			jphnum.textContent = plus.webview.currentWebview().jphonenum
			
			
	        document.getElementById('buttonm').addEventListener('tap',function(){
	      		var phonenum = document.getElementById('inputt').value;
		      	var PATTERN_CHINAMOBILE = /^1(3[4-9]|5[012789]|8[23478]|4[7]|7[8])\d{8}$/; //移动号
				var PATTERN_CHINAUNICOM = /^1(3[0-2]|5[56]|8[56]|4[5]|7[6])\d{8}$/; //联通号
				var PATTERN_CHINATELECOM = /^1(3[3])|(8[019])\d{8}$/; //电信号
	      		if(phonenum == ""){
	      			mui.alert('输入手机号不能为空！')
	      		}else{
	      			 if ((PATTERN_CHINAUNICOM.test(phonenum)  || PATTERN_CHINAMOBILE.test(phonenum)  || PATTERN_CHINATELECOM.test(phonenum)) && phonenum.length == 11) {
			             mui.openWindow({
			             	url: 'yanzhengma.html',
			             	id: 'yanzhengma.html',
			             	extras:{
					           phonenum: phonenum
					        }
			             })
	      			 }else{
	      			 	mui.alert("手机号输入不正确！");
	      			 }
	      		}
           })
	   })		
	}		
		</script>
	</body>

</html>